package com.framework.mybatis.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Administrator
 */
@Data
@Accessors(chain = true) //实体允许链式操作
@JsonIgnoreProperties(ignoreUnknown = true)
public abstract class BaseEntity implements Serializable {
    @Id
    @ApiModelProperty(value = "主键id")
    @TableField(value = "`id`", fill = FieldFill.INSERT)
    private Long id;

    @TableField(value = "corp_id", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "企业id")
    private Long corpId;

    @TableField(value = "create_id", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "操作者")
    private Long createId;

    @TableField(value = "create_date", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private Date createDate;

    @TableField(value = "update_id", fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "操作者")
    private Long updateId;

    @TableField(value = "update_date", fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "更新时间")
    private Date updateDate;

    @TableField(value = "delete_state", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "删除状态 0正常 1删除")
    private Boolean deleteState;
}
